package com.mobiftpcms.webapp.controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.mobiftpcms.service.LogManager;

@Controller
@RequestMapping(value="/admin/log")
public class LogController {
	private static org.apache.commons.logging.Log log = LogFactory.getLog(LogController.class);
	
	@Autowired
	private LogManager logManager;
	
	@RequestMapping(method = RequestMethod.GET)
	public ModelAndView handleRequest(HttpServletRequest request) {
		if(log.isDebugEnabled()) {
			log.debug("Populating Values...");
		}
		
		return new ModelAndView("admin/log","logList",logManager.getLogs());
	}	
}
